<?php
namespace app\common\model;
use think\facade\Request;
/**
 * 用户模型类
 * Class User
 * @package app\common\model
 */
class LoginLog extends BaseModel
{
    protected $name = 'login_log';

    
	public function addlog($username,$ip)
	{
	    $ip = isset($ip)?$ip:'';
		$data['user_name']=$username;
		$data['ip']=$ip;
		$this->save($data);
	}

	public function getAll($param)
	{
		return $this->where('user_name','=',self::$user_name)
		->order('id desc')->paginate(10,false,['query'=>$param]);
//		->paginate(10, false, [
//                'query' => $param]);
	}
}